import React from 'react';
import { Breadcrumb } from 'antd';
import styles from './index.module.less'

const CommonBreadcrumb = ({ data = [] }) => {

  return (
    <Breadcrumb style={{ marginBottom: 16 }}>
      {
        data.map((item, index) => {
          return (
            <Breadcrumb.Item onClick={item.onClick} key={index}>
              {item.path ?
                <a href={item.path}>{item.title}</a>
                : item.onClick ? <span className={styles.cursorBread}>{item.title}</span> : <span>{item.title}</span>
              }
            </Breadcrumb.Item>
          )
        })
      }
    </Breadcrumb>
  );
};

export default CommonBreadcrumb;